<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>选课列表</title>
    <!-- 引入CSS和JS资源 -->
</head>
<body>
<h1>选课列表</h1>
<form th:action="@{/score/listScore}" method="get">
    <input type="text" name="sno" placeholder="搜索学号" />
    <button type="submit">搜索</button>
</form>
<table>
    <thead>
    <tr>
        <th>学号</th>
        <th>课程号</th>
        <th>成绩</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="score : ${scores}">
        <td th:text="${score.sno}">学号</td>
        <td th:text="${score.cno}">课程号</td>
        <td th:text="${score.score}">成绩</td>
        <td>
            <a th:href="@{${'/score/preUpdateScore/' + score.sno + '/' + score.cno}}">编辑</a>
            <a th:href="@{/score/delScore/{sno}(sno=${score.sno})}">删除</a>
        </td>
    </tr>
    </tbody>
</table>
<!-- 添加新课程表单 -->
<h2>添加教师</h2>
<form th:action="@{/score/saveScore}" method="post" >
    <!-- 课程编号，假设是必填项且为文本输入 -->
    <label for="sno">学号</label>
    <select id="sno" name="sno">
        <option th:each="student : ${studentList}" th:value="${student.sno}" th:text="${student.sno}"></option>
    </select><br>
    <label for="cno">课程号</label>
    <select id="cno" name="cno">
        <option th:each="course : ${courseList}" th:value="${course.cno}" th:text="${course.cno}"></option>
    </select><br>
    <!-- 课程名称，假设是必填项且为文本输入 -->
    <label for="grade">分数</label>
    <input type="number" id="grade" name="grade" required><br>

    <!-- 提交按钮 -->
    <input type="submit" value="提交">
</form>
</body>
</html>